home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1997 September
/
Macworld (1997-09).dmg
/
Shareware World
/
Comms & Internet
/
Mail*Link SMTP⁄QM Installer
/
Disk 3
/
Sources & Scripts
/
Scripts
/
passwd.script
< prev
next >
Wrap
Text File
|
1989-05-17
|
949b
|
29 lines
:
cut -f1 -d":" /etc/passwd > /tmp/file1$$
cut -f5 -d":" /etc/passwd > /tmp/file2$$
cut -f1 -d" " /tmp/file2$$ > /tmp/temp1$$
cut -f2 -d" " /tmp/file2$$ > /tmp/temp2$$
num_lines=`wc -l /tmp/file1$$ | sed "s/[ ]*\([0-9]*\).*/\1/"`
while ( test $num_lines -gt 0 )
do
echo '"' >> /tmp/quotes0$$
echo '"' >> /tmp/quotes1$$
echo '"' >> /tmp/quotes2$$
echo '"' >> /tmp/quotes3$$
echo ',' >> /tmp/comma$$
echo ' ' >> /tmp/tab$$
echo "`hostname`" >> /tmp/hostname$$
echo '@' >> /tmp/at$$
num_lines=`expr $num_lines - 1`
done
paste -d'\0' /tmp/quotes0$$ /tmp/temp2$$ /tmp/comma$$ \
/tmp/temp1$$ /tmp/quotes1$$ /tmp/tab$$ /tmp/quotes2$$ \
/tmp/file1$$ /tmp/at$$ /tmp/hostname$$ \
/tmp/quotes3$$ | grep -v '","'
rm -f /tmp/quotes0$$ /tmp/temp2$$ /tmp/comma$$ \
/tmp/temp1$$ /tmp/quotes1$$ /tmp/tab$$ /tmp/quotes2$$ \
/tmp/hostname$$ /tmp/at$$ /tmp/file1$$ /tmp/quotes3$$ \
/tmp/file2$$